class CreateMilestones < ActiveRecord::Migration
  def self.up
    create_table :milestones do |t|
      t.string    :title, :null => false
      t.datetime  :started_on, :null => false
      t.datetime  :completed_on
      t.text      :description
      t.integer   :status_code, :default => 0, :null => false
      t.integer   :project_id, :null => false
      t.timestamps
    end
    
    add_index :milestones, :project_id
  end

  def self.down
    drop_table :milestones
  end
end
